using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Swaf;

public partial class rss : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
		Response.ContentType = "text/xml";
		string id = Request["id"];
		if (id != null)
		{
			Uri reqUrl = Request.Url;
			//Uri link, bool includeAllChildren, bool leafNodesOnly, string albumLink, object articleId, string bizObjType
			IApplication app = Swaf.Application.currentApp;
			string x = reqUrl.AbsoluteUri.Substring(0, reqUrl.AbsoluteUri.IndexOf(reqUrl.AbsolutePath));
			string loc = string.Format(app.resMgr.resolve("{0}$CmpSetting(sitePath)$/rss/{1}.aspx"), x, id);
			Uri rssBaseUrl = new Uri(loc);
			IResults rc = app.ruleMgr.execute("getArticleRss",id, rssBaseUrl);
			string xml = rc.CallResults as string;
			Response.Write(xml);
		}
        Response.End();
    }
}
